package com.stylefeng.guns.modular.netcar.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.stylefeng.guns.core.validater.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.annotations.Insert;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper=true)
@TableName("line_time_slot")
 /**
 * 线路发车时刻排班
 *
 * @author 张亚林
 * @Date 2018-10-27 09:55
 * @TableField(exist = false) 实现属性与数据库字段不一一对应
 */
public class LineTimeSlot extends Model<LineTimeSlot> {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     * 自动生成后修改成实际的主键 
     */
    protected Serializable pkVal() {
        return this.ltsId;
    }
    
    //扩展能查询字段
    @TableField(exist = false)
    @JSONField(serialize = false)
    private String key ;
    //开始日期
    @TableField(exist = false)
    @JSONField(serialize = false)
    private String sdate;
    //截止日期 
    @TableField(exist = false)
    @JSONField(serialize = false)
	private String edate;
    //排序字段
    @TableField(exist = false)
    @JSONField(serialize = false)
	private String  sortField ;
	//排序	
	@TableField(exist = false)
    @JSONField(serialize = false)
	private String sortOrder;

	
    @ApiModelProperty(value = "ID")
    @TableField("lts_id")
    @NotNull(message = "ID不能为空",groups = {Update.class})
    private String ltsId;     //

    @ApiModelProperty(value = "线路ID")
    @TableField("ol_id")
    @NotNull(message = "城市名不能为空",groups = {Insert.class,Update.class})
    private String olId;     //线路ID

    @ApiModelProperty(value = "开始时刻")
    @TableField("lts_start_time")
    private Date ltsStartTime;     //开始时刻

    @ApiModelProperty(value = "截止时刻")
    @TableField("lts_end_time")
    private Date ltsEndTime;     //截止时刻

    @ApiModelProperty(value = "创建人")
    @TableField("create_user")
    private String createUser;     //创建人

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private Date createTime;     //创建时间

    @ApiModelProperty(value = "更新人")
    @TableField("update_user")
    private String updateUser;     //更新人

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private Date updateTime;     //更新时间

    @ApiModelProperty(value = "发车日期")
    @TableField("lts_date")
    private Date ltsDate;     //发车日期

    @ApiModelProperty(value = "最大票数 负数时不限制")
    @TableField("lts_max_num")
    private Integer ltsMaxNum;     //最大票数 负数时不限制

    @ApiModelProperty(value = "已售数量")
    @TableField("lts_sale_num")
    private Integer ltsSaleNum;     //已售数量


}
